Page({
        data:{
            list:[
                {name:'C',active:true},
                {name:'D',active:false},
                {name:'E',active:false},
                {name:'F',active:false},
                {name:'G',active:false},
                {name:'A',active:false},
                {name:'B',active:false},
            ],
            src:'images/c.png'
        },
        c(e){
        console.log(e)
        //获取当前对象的id
        var id=e.currentTarget.dataset.id
        console.log(id)
        //取出list里的所有active并设置为false
        this.data.list.forEach(v=>{v.active=false})
        //当前的active设置为true
        this.data.list[id].active=true
        //修改src的值，toLowerCase（）把大写字母转换成小写
        this.data.src='images/'+this.data.list[id].name.toLowerCase()+'.png'
        console.log(this.src)
        //把数据发给页面渲染
        this.setData({
            list:this.data.list,
            src:this.data.src
        })
    }
    })